KERNAL_DIR := /home/linxincheng/imx6ull/bsp/kernel/linux-imx 
CROSS_COMPILE := /opt/gcc-arm-11.2-2022.02/bin/arm-none-linux-gnueabihf-gcc 
TFTP_DIR := /tftp/linxincheng 
PWD := $(shell pwd) 
obj-m := led_gpio.o
app_name = led_app

modules:
	$(MAKE) -C $(KERNAL_DIR) M=$(PWD) modules
	@${CROSS_COMPILE} ${app_name}.c -o led_app
	@make clear
	sudo cp led_gpio.ko led_app ${TFTP_DIR} -f

clear:
	@rm -f *.o *.cmd *.mod *.mod.c
	@rm -rf *~ core .depend .tmp_versions Module.symvers modules.order -f
	@rm -f .*ko.cmd .*.o.cmd .*.o.d
	@rm -f *.unsigned

clean:
	@rm -f *.ko

